﻿using System.Web.UI.DataVisualization.Charting;
using System.Web.UI.WebControls;
using System.Drawing;

namespace Z16.BLI
{
    public class ChartComponents
    {
        public Series CreateSeriesColumnControl(string PieLabelStyle)
        {
            Series series = new Series("Default");
            series.ChartType = SeriesChartType.Column;
            //series["PieLabelStyle"] = PieLabelStyle;
            return series;
        }
        public Legend CreateChartLegend(string TitleLabel)
        {
            Legend legend = new Legend();
            legend.Title = TitleLabel;
            legend.Name = TitleLabel;            
            legend.Enabled = true;
            return legend;
        }
        public Font GetFontCourierNew(int FontStyle)
        {
            Font font = new Font("CourierNew", FontStyle);
            return font;
        }
        public ChartArea CreateChartArea(int rotation)
        {
            ChartArea chartArea = new ChartArea();
            ChartArea3DStyle areaStyle = new ChartArea3DStyle(chartArea);
            areaStyle.Rotation = rotation;
            Axis yAxis = new Axis(chartArea, AxisName.Y);
            Axis xAxis = new Axis(chartArea, AxisName.X);
            return chartArea;
        }
        public Unit CreateChartWidth(double width)
        {
            return new Unit(width, UnitType.Pixel);
        }
        public Unit CreateChartHeight(double Height)
        {
            return new Unit(Height, UnitType.Pixel);
        }

    }
}